#include <iostream>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <termios.h>
#include "Channel.h"
#include "Module.h"
class Uart:public Module
{
public:
    Uart(const std::string &device,unsigned int baudrate, unsigned char dbit = 8, char parity = 'N', unsigned char sbit = 1);
    ~Uart();
    
    bool initialize(const std::string &device);
    bool configure(unsigned int baudrate, unsigned char dbit = 8, char parity = 'N', unsigned char sbit = 1);
    int getfd()const {return m_fd;}
private:
    struct termios ucfg;
};